home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 07 - 1991 / 07.08 Aug 91 / Dots Source / cDotsDoc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-11-18  |  1.5 KB  |  52 lines  |  [TEXT/KAHL]

  1. /************************************
  2.     cDotsDoc.h
  3.  ************************************/
  4.  
  5. #define    _H_cDotsDoc            /* Include this file only once */
  6. #include <CDocument.h>
  7.  
  8. #include "cDotsPane.h"
  9. #include "cScorePane.h"
  10. #include "dotsTypes.h"
  11.  
  12. /*** Class Types ***/
  13.     /* Types used to store state of game */
  14. typedef tLineState     tLines[vLine+1][kMaxRow+1][kMaxCol+1];
  15. typedef tBoxState    tBoxes[kMaxRow+1][kMaxCol+1];
  16.  
  17.  
  18. struct cDotsDoc : CDocument {
  19.  
  20.         /* Instance Variables */
  21.     cDotsPane    *fDotsPane;        /* the view of the game */
  22.     cScorePane    *fScorePane;    /* the view of the score */
  23.     Boolean        fPlayerTurn;    /* whose turn */
  24.     tLines        fLines;            /* state of every line */
  25.     tBoxes        fBoxes;            /* state of every box */
  26.  
  27.     DialogPtr    printBanner;    /* inform user printing in progress */
  28.  
  29.         /* Initialization */
  30.     void        IDotsDoc(CBureaucrat *aSupervisor, Boolean printable);
  31.  
  32.         /* Override Methods */
  33.     void        NewFile(void);
  34.     void        OpenFile(SFReply *macSFReply);
  35.     Boolean    DoSave(void);
  36.     Boolean    DoSaveAs(SFReply *macSFReply);
  37.     void        DoRevert(void);
  38.     short    PageCount(void);
  39.     void        AboutToPrint(short *firstPage, short *lastPage);
  40.     void        PrintPageOfDoc(short pageNum);
  41.     void        DonePrinting(void);
  42.  
  43.         /* Additional Methods */
  44.     void        BuildWindow(Handle theData);
  45.     
  46.     void        storeData(Handle theData);
  47.     tBoxState    getBoxState(int    row, int col);
  48.     Boolean    getLineState(tLineDir direction, int row, int col);
  49.     void        setLineState(tLineDir direction, int row, int col, Boolean thePlayer, Boolean newState);
  50.     Boolean    changeBoxState(int row, int col, Boolean thePlayer, Boolean addingLine);
  51.     Boolean    getPlayerTurn(void);
  52. };